

package com.hazelcast.jet.impl.operation;

import com.hazelcast.jet.core.JobSuspensionCause;
import com.hazelcast.jet.impl.execution.init.JetInitDataSerializerHook;
import com.hazelcast.spi.impl.AllowedDuringPassiveState;

import java.util.concurrent.CompletableFuture;

public class GetJobSuspensionCauseOperation extends AsyncJobOperation implements AllowedDuringPassiveState {

    public GetJobSuspensionCauseOperation() {
    }

    public GetJobSuspensionCauseOperation(long jobId) {
        super(jobId);
    }

    @Override
    protected CompletableFuture<JobSuspensionCause> doRun() {
        return getJobCoordinationService().getJobSuspensionCause(jobId());
    }

    @Override
    public int getClassId() {
        return JetInitDataSerializerHook.GET_JOB_SUSPENSION_CAUSE_OP;
    }
}
